package designpattern.mvc.v1;
import java.awt.FlowLayout;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JTextField;
public class View extends JFrame {//视图类，不与计算耦合
 protected JTextField a,b,c;
 protected JLabel addJLabel;
 protected JButton addButton;
 public View() {
  this.setSize(700, 90);
  this.setLayout(new FlowLayout());
  a = new JTextField("0", 10);
  this.add(a);
  addJLabel = new JLabel("+");
  this.add(addJLabel);
  b = new JTextField("0", 10);
  this.add(b);
  addButton = new JButton("=");
  this.add(addButton);
  c = new JTextField("0", 10);
  this.add(c);
  this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  this.setVisible(true);
 }
}